<table>
    <tbody>
        <tr>
            <td width="150px"><?php echo $form->label('CustStockInHead.stock_in_no', 'Stock in no.'); ?></td>
            <td><?php echo $form->text('CustStockInHead.stock_in_no'); ?></td>
        </tr>
        <tr>
            <td width="150px"><?php echo $form->label('CustStockInHead.stock_in_date', 'Stock in date'); ?></td>
            <td>
                From
                <?php echo $form->text('CustStockInHead.stock_in_date_start', array('size' => 10)); ?>
                To
                <?php echo $form->text('CustStockInHead.stock_in_date_end', array('size' => 10)); ?>
            </td>
        </tr>
        <?php if ($session->read('Auth.User.Extend.from_supplier') != true) : ?>
        <tr>
            <td><?php echo $form->label('CustStockInHead.dispatch_from', 'Dispatch from'); ?></td>
            <td>
                <?php echo $form->radio('CustStockInHead.dispatch_from', array(ITS_PREFIX => 'ITS', SUPPLIER_PREFIX => 'Other Vendor'), array('legend' => false)); ?><br />
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
                <?php echo $form->select('CustStockInHead.supplier_id', $suppliers, null, array('style' => 'display: none;')); ?>
            </td>
        </tr>
        <?php endif; ?>
    </tbody>
</table>
<script type="text/javascript">
    $j(function() {
        $j.datesearchpicker("#CustStockInHeadStockInDate");
        $j(':radio').bind('click', function() {
            var dispatch_from = $j(this).val();
            if (dispatch_from == SUPPLIER_PREFIX) {
                $j('#CustStockInHeadSupplierId').show();
            } else {
                $j('#CustStockInHeadSupplierId').hide().val('');
            }
        });
    })
</script>